﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace DetectiveCluedo
{
    public class Player
    {
        public string Name;
        public bool IsYou;
        public Card[] Cards;
        public int CardsCount;
        public Color Color
        {
            get
            {
                return CluedoGame.Cards.Where(c => c.Type.Equals(ECardType.Suspect) && c.Name.Equals(this.Name)).FirstOrDefault().Color;
            }
        }

        public override string ToString()
        {
            return string.Format("{0}{1} ({2})", Name, (IsYou)?"*":"", CardsCount);
        }

        public override bool Equals(object obj)
        {
            Player p = (Player)obj;

            if (p == null)
                return false;

            return this.Name.Equals(p.Name) && this.CardsCount.Equals(p.CardsCount) && this.IsYou == p.IsYou;
        }
    }
}
